<template>
  <ul class="contextmenu-wrap" :style="{ left: x + 'px', top: y + 'px' }">
    <li @click.stop="callBack('remove')">删除</li>
  </ul>
</template>

<script lang="ts" setup> 
import {ref,defineEmits} from 'vue';
const emit=defineEmits(['callBack']);
const x=ref('');
const y=ref('');
const item=ref({});
const initFn=(x, y, item)=> {
      x.value = parseInt(x) + "";
      y.value = parseInt(y) + "";
      if (item) {
        item.value = item;
      }
    }
   const callBack=(type)=> {
      emit("callBack", type, item.value);
    }
</script>
<style lang="scss" scoped>
.contextmenu-wrap {
  width: 150px;
  position: fixed;
  z-index: 999;
  // border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  font-size: 12px;
  color: #545454;
  background: #1d2035;
  padding: 10px 8px;
  box-shadow: rgb(174, 174, 174) 0px 0px 10px;

  > li {
    color: #ffffff;
    cursor: pointer;
    text-align: center;
    // background: rgba(37, 50, 82, 0.2);
  }
}
</style>